package com.ny.demo;

public class Dcc {
    public static void main(String[] args) {
        class Animal {
            protected String name;
            protected int age;
            protected String furColor;

            public Animal(String name, int age, String furColor) {
                this.name = name;
                this.age = age;
                this.furColor = furColor;
            }

            public void makeSound() {
                System.out.println("Animal sound");
            }

            public void printInfo() {
                System.out.println("Name: " + name + ", Age: " + age + ", Fur Color: " + furColor);
            }
        }

        class Dog extends Animal {
            public Dog(String name, int age, String furColor) {
                super(name, age, furColor);
            }
            public void makeSound() {
                System.out.println("Dog sound: Bark!");
            }
        }

        class Cat extends Animal {
            public Cat(String name, int age, String furColor) {
                super(name, age, furColor);
            }


            public void makeSound() {
                System.out.println("Cat sound: Meow!");
            }
        }



                Dog dog = new Dog("Buddy", 3, "Brown");
                Cat cat = new Cat("Whiskers", 2, "Black");

                dog.printInfo();
                dog.makeSound();

                cat.printInfo();
                cat.makeSound();
            }
        }

